<?php
/**
 * 转账管理
 */
namespace app\common\model;

use think\Model;

class MemberEntrust extends Model
{
    protected $autoWriteTimestamp = 'datetime';
    protected $updateTime = false;

    /**
     * 添加用户交易记录
     */
    public  function add_entrust($data)
    {
        return $this->create($data)->id;
    }


    /**
     * 数据列表
     */
    public  function entrust_list($where,$page,$limit)
    {
        $data['data'] = $this->where($where)->page($page,$limit)->order('create_time desc')->select()->toArray();

        $data['count'] = $this->where($where)->count();

        return $data;

    }

    /**
     * 获取数据
     */
    public  function git_data($id,$mid)
    {
        return $this->where(['id'=>$id,'entrust_state'=>1,'mid'=>$mid])->find();
    }

    /**
     * 修改数据
     */
    public function up_data($data)
    {
        return $this->update($data);
    }
}